package com.mtsmda.oracleOfficialTutorialJAVA7.chapter1.nestedClasses;

public class OuterClassEx {
	public static void main(String[] args) {
		OuterClass outerClass = new OuterClass();
//		new OuterClass().new InnerClass();
		OuterClass.InnerClass innerClass = outerClass.new InnerClass();
		innerClass.print(195, "Dmitrii param", 25.0, (byte)19);

	}
}

class OuterClass {
	private int count = 0;
	String name = "Dmitrii";
	protected double pi = 3.14;
	public byte byteB = 127;

	class InnerClass {
		private int count = 1;
		String name = "Dmitrii 1";
		protected double pi = 3.14_1;
		public byte byteB = -127;

		public void print(int count, String name, double pi, byte byteB) {
			StringBuilder builder = new StringBuilder();
			builder.append("params - ").append(count).append(" ,").append(name)
					.append(" ,").append(pi).append(" ,").append(byteB)
					.append("\n");

			builder.append("inner Class variables - ").append(this.count)
					.append(" ,").append(this.name).append(" ,")
					.append(this.pi).append(" ,").append(this.byteB)
					.append("\n");

			builder.append("outer Class variables - ")
					.append(OuterClass.this.count).append(" ,")
					.append(OuterClass.this.name).append(" ,")
					.append(OuterClass.this.pi).append(" ,")
					.append(OuterClass.this.byteB).append("\n");
			System.out.println(builder.toString());
		}
	}

}